require "Common/class"
require "Common/Base/BaseCtrl"
require "View/HallPanel"

HallCtrl = class("HallCtrl",BaseCtrl)

function HallCtrl:Awake(resName)
	self.curPanel = HallPanel.New("HallPanel")
	self.super:Awake(resName,self)
end

function HallCtrl:ShowPanel(data)
	self.super.ShowPanel(self,data)
end

function HallCtrl:InitCtrl()
	CtrlManager.ClosePanel(CtrlNames.Login)
end

function HallCtrl:AddUIEvent()	
	self.luaBehaviour:AddClick(self.curPanel.btn_set,function ()
		if ButtonHandle:ClickFastHand() then return end
		self:Click_Set()
	end)

	self.luaBehaviour:AddClick(self.curPanel.btn_email,function ()
		if ButtonHandle:ClickFastHand() then return end
		self:Click_Email()
	end)

	self.luaBehaviour:AddClick(self.curPanel.btn_record,function ()
		if ButtonHandle:ClickFastHand() then return end
		self:Click_Record()
	end)

	self.luaBehaviour:AddClick(self.curPanel.btn_shared,function ()
		if ButtonHandle:ClickFastHand() then return end
		self:Click_Shared()
	end)

	self.luaBehaviour:AddClick(self.curPanel.btn_shop,function ()
		if ButtonHandle:ClickFastHand() then return end
		self:Click_Shop()
	end)

	self.luaBehaviour:AddClick(self.curPanel.btn_create,function ()
		if ButtonHandle:ClickFastHand() then return end
		self:Click_CreateRoom()
	end)

	self.luaBehaviour:AddClick(self.curPanel.btn_join,function ()
		if ButtonHandle:ClickFastHand() then return end
		self:Click_JoinRoom()
	end)
end

function HallCtrl:AddListener()
	
end

function HallCtrl:RemoveListener()
	
end

function HallCtrl:Click_Set()
	log("点击了设置按钮")
	CtrlManager.ShowPanel(CtrlNames.Setting,nil ,3)
end

function HallCtrl:Click_Email()
	log("点击了邮件按钮")
end

function HallCtrl:Click_Record()
	log("点击了战绩按钮")
end

function HallCtrl:Click_Shared()
	log("点击了分享按钮")
end

function HallCtrl:Click_Shop()
	log("点击了商城按钮")
end

function HallCtrl:Click_JoinRoom()
	CtrlManager.ShowPanel(CtrlNames.JoinRoom,nil,3)
end

function HallCtrl:Click_CreateRoom()
end


